from django.conf import settings
from .SmsSDK import SmsSDK
import json

accId = settings.SMS_INFO.get('ACCID')
accToken = settings.SMS_INFO.get('ACCTOKEN')
appId = settings.SMS_INFO.get('APPID')


def send_message(tid, mobile, datas):
    sdk = SmsSDK(accId, accToken, appId)
    resp = sdk.sendMessage(tid, mobile, datas)
    resp = json.loads(resp)
    print(resp)
    return resp.get('statusCode') == '000000'

